﻿namespace FastEasyAPI.Module
{
    public static class CorsModule
    {
        public static void AddCorsModule(this IServiceCollection Services)
        {
            Services.AddCors(c =>
            {
                c.AddPolicy("All", policy =>
                {
                    policy.AllowAnyHeader()
                    .AllowAnyMethod()
                    .AllowAnyOrigin();
                });
            });
        }

        public static void UseCorsModule(this IApplicationBuilder app)
        {
            app.UseCors("All");
        }
    }
}